/*
 * @(#)MaintWorkflowQueryRecordForm.java
 *
 * Copyright (c) 2004 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.workflow.web;


import com.dcivision.framework.ApplicationException;
import com.dcivision.framework.TextUtility;
import com.dcivision.framework.bean.AbstractBaseObject;
import com.dcivision.framework.web.AbstractSearchForm;
import com.dcivision.workflow.bean.WorkflowQueryRecord;

/**
  MaintWorkflowStepForm.java

  This class is the for web form purpose.

  @author      Angus Shiu
  @company     DCIVision Limited
  @creation date   05/08/2003
  @version     $Revision: 1.3 $
*/

public class MaintWorkflowQueryRecordForm extends AbstractSearchForm {

  public static final String REVISION = "$Revision: 1.3 $";
  private String ID=null;  
  private String queryName=null;
  private String queryType = "P";
  private String description=null;
  private String userRecordID=null;
  private Object xmlQuery=null;
  private String workflowGroupID = null;
  
 
  public MaintWorkflowQueryRecordForm() {
    super();
  }

  /**
   * @return Returns the iD.
   */
  public String getID() {
  	return ID;
  }
  /**
   * @param id The iD to set.
   */
  public void setID(String id) {
  	ID = id;
  }
  
  /**
   * @return Returns the description.
   */
  public String getDescription() {
  	return description;
  }
  /**
   * @param description The description to set.
   */
  public void setDescription(String description) {
  	this.description = description;
  }
  /**
   * @return Returns the userRecordID.
   */
  public String getUserRecordID() {
  	return userRecordID;
  }
  /**
   * @param userRecordID The userRecordID to set.
   */
  public void setUserRecordID(String userRecordID) {
  	this.userRecordID = userRecordID;
  }
  /**
   * @return Returns the xmlQuery.
   */
  public Object getXmlQuery() {
  	return xmlQuery;
  }
  /**
   * @param xmlQuery The xmlQuery to set.
   */
  public void setXmlQuery(Object xmlQuery) {
  	this.xmlQuery = xmlQuery;
  }
  /**
   * @return Returns the queryName.
   */
  public String getQueryName() {
  	return queryName;
  }
  /**
   * @param queryName The queryName to set.
   */
  public void setQueryName(String queryName) {
  	this.queryName = queryName;
  }
  /**
   * @return Returns the queryType.
   */
  public String getQueryType() {
  	return queryType;
  }
  /**
   * @param queryType The queryType to set.
   */
  public void setQueryType(String queryType) {
  	this.queryType = queryType;
  }
  
  public String getWorkflowGroupID() {
  	return workflowGroupID;
  }
  public void setWorkflowGroupID(String workflowGroupID) {
  	this.workflowGroupID = workflowGroupID;
  }
  
	/* (non-Javadoc)
	 * @see com.dcivision.framework.web.AbstractActionForm#setFormData(com.dcivision.framework.bean.AbstractBaseObject)
	 */
	public void setFormData(AbstractBaseObject baseObj) throws ApplicationException {
		WorkflowQueryRecord workflowQueryRecord = (WorkflowQueryRecord)baseObj;
		this.setID(TextUtility.formatIntegerObj(workflowQueryRecord.getID()));
		this.setDescription(workflowQueryRecord.getQueryDescription());
		this.setQueryName(workflowQueryRecord.getQueryName());
		this.setQueryType(workflowQueryRecord.getQueryType());
		this.setUserRecordID(TextUtility.formatIntegerObj(workflowQueryRecord.getUserRecordID()));
		this.setXmlQuery(workflowQueryRecord.getXmlQuery());
		this.setWorkflowGroupID(TextUtility.formatIntegerObj(workflowQueryRecord.getWorkflowGroupID()));
	}
	
	
	
	
	
	/* (non-Javadoc)
	 * @see com.dcivision.framework.web.AbstractActionForm#getFormData()
	 */
	public AbstractBaseObject getFormData() throws ApplicationException {
		WorkflowQueryRecord workflowQueryRecord = new WorkflowQueryRecord();
		workflowQueryRecord.setID(TextUtility.parseIntegerObj(this.getID()));
		workflowQueryRecord.setQueryDescription(this.getDescription());
		workflowQueryRecord.setQueryName(this.getQueryName());
		workflowQueryRecord.setQueryType(this.getQueryType());
		workflowQueryRecord.setUserRecordID(TextUtility.parseIntegerObj(this.getUserRecordID()));
		workflowQueryRecord.setXmlQuery(this.getXmlQuery());
		workflowQueryRecord.setWorkflowGroupID(TextUtility.parseIntegerObj(this.getWorkflowGroupID()));
		return workflowQueryRecord;
	}
}
